﻿#pragma once
#include "include/cef_scheme.h"
#include "include/wrapper/cef_helpers.h"
#include "include/wrapper/cef_stream_resource_handler.h"

class HttpSchemeFactory :public CefSchemeHandlerFactory
{
public:
    HttpSchemeFactory() = default;
    ~HttpSchemeFactory() = default;

    HttpSchemeFactory(const HttpSchemeFactory&) = delete;

    HttpSchemeFactory& operator = (const HttpSchemeFactory&) = delete;

    CefRefPtr<CefResourceHandler> Create(CefRefPtr<CefBrowser> browser, 
        CefRefPtr<CefFrame> frame, 
        const CefString& scheme_name, 
        CefRefPtr<CefRequest> request) override;
    
private:
    IMPLEMENT_REFCOUNTING(HttpSchemeFactory);
};